#ifndef prs_FrmFrameStyle_H
#define prs_FrmFrameStyle_H

#include "prs_FrmFunc.h"
#include "prs_FrmRules.h"
#include "prs_FrmStyleState.h"
#include "frm_control_TFrame.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmFrameStyle : public TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_Frame> NodeType;
  TAttrObject<nodeType_Style,frm::control::TFrame::TStyle> Style;
  //
  TNodeFrmFrameStyle() : NodeType(this),Style(this) { 
													  Style.Value.VScroll.SetDefault();
													  Style.Value.HScroll.SetDefault();
													}
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmFrameStyle : public snt::TRule
{
  TRuleFrmFrameStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmFrameStyle *GetNode() { return dynamic_cast<TNodeFrmFrameStyle*>(vParentNode.Pointer());}
  //
  void FFrame(snt::TParams &Params)		  { rStyleState.SetState(&GetNode()->Style.Value ); }
  void FPanelScroll(snt::TParams &Params) { rStyleState.SetState(&GetNode()->Style.Value.PanelScroll ); }
  void FClient(snt::TParams &Params)	  { rStyleState.SetState(&GetNode()->Style.Value.Client ); }
  bool FVScrollBar(snt::text::TIdent::TFuncClosureDoEntryParams &Params);
  bool FHScrollBar(snt::text::TIdent::TFuncClosureDoEntryParams &Params);
  //
  svl::TVariant &vParentNode;
  snt::TAlter A;
  TRuleFrmStyleState &rStyleState;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
